package com.yunji.web.base;

import com.yunji.base.business.MangerBusiness;
import com.yunji.base.dto.ManagerDTO;
import com.yunji.common.base.BaseController;
import com.yunji.common.base.response.Response;
import com.yunji.common.base.response.ResponseHelper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @version 1.0
 * @Project: yunji-coffee
 * @Package com.yunji.web.user
 * @FileName MangerController.java
 * @Copyright Copyright © 2024 云集互联. All Rights Reserved
 * Company		com
 * @CreateTime 2024-05-30 13:50:12
 * @Description 经理信息交互
 * @Modification Author                    History Time			Version				Description
 * --------------------------------------------------------------------------------
 * HuaAo0803@163.com	2024-05-30 13:50:12		1.0					1.0 Version
 * @since JDK 1.8.0_202
 */
@RestController
@Api(tags = "管理端-经理信息")
@RequestMapping("/container/manager")
public class MangerController extends BaseController {
    @Resource
    MangerBusiness business;

    @ApiOperation("获取当前登录经理信息")
    @GetMapping("/getManagerInfo")
    public Response<ManagerDTO> currentSite() {
        return ResponseHelper.success(business.currentSite());
    }

    @ApiOperation("通过ID获取经理信息")
    @PreAuthorize("@ss.hasPermi('container:site:info')")
    @GetMapping("/getManagerInfoByManagerId")
    public Response<ManagerDTO> getSiteInfo(@RequestParam("managerId") Long managerId) {
        return ResponseHelper.success(business.getSiteInfo(managerId));
    }
}